Repository navigation
fix: stop sending the gateway metadata request header - #50
Draft
steve-calvert-glean wants to merge 1 commit into
Draft
steve-calvert-glean wants to merge 1 commit into
steve-calvert-glean wants to merge 1 commit into
Conversation
The plugin's local server sent X-Glean-Gateway-Request-Metadata on every request to Glean. Glean reads that header only on requests from its own services, and the plugin stopped identifying as one in 3.6.0, so the header has had no effect since then. It is also an internal header, which Glean's edge can reject on a request from outside. Remove the header, the hand-written encoder that built it, and the chatSessionId parameter that existed only to fill it. The header test now asserts that no request header starts with X-Glean-.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The plugin's local server sends
X-Glean-Gateway-Request-Metadataon every request to Glean. Glean reads that header only on requests from its own services. The plugin stopped identifying as one in 3.6.0, so the header has had no effect since then.It is also an internal header. Glean's edge can reject a request from outside that carries one. #41 removed the other internal headers for the same reason.
Change
buildGatewayMetadataHeaderand its hand-written encoder.chatSessionIdparameter ofcreateRemoteClient. It existed only to fill the header.X-Glean-. Before, it asserted that this header was present.No behavior changes for users. This applies to Claude Code, Cursor, and Codex, because all three use the same local server.
Verification
main:expected [ 'x-glean-gateway-request-metadata' ] to deeply equal []. It passes with this change.npm run typecheck:bundlepasses.npm run test:bundlepasses: 24 files, 430 tests.npm testbuilds and validates theclaude,cursor, andcodexoutputs.dist/contains the stringx-glean-.Not verified: a live request to a Glean deployment with the built plugin.